Field{T}

A Field class is provided in the .NET Script operation to handle qualities and timestamps. Note that the Field class is a generic class and a type needs to be specified for its Value property.

 

It enables the manipulation of qualities and timestamps. Output fields are of integer, DateTime, string and double types, and only a null value in the table will indicate a bad quality data point.

 

The field type can be used when declaring global variables (under the variables tab) to logically group quality, timestamp and value information in a single class.

 

Class properties

T Value The value of the field, which can be any type.
DateTime Timestamp The timestamp of the field.
int Quality The quality of the field.

 

The constructor

Field(T value)

{

Value = value

Timestamp = DateTime.Now

Quality = Good

}

 

  • Value: Only the value is passed to the constructor.

  • Timestamp: The timestamp is set to the current time.

  • Quality: The quality is set to Good.

Class methods

void SetQualityGood() Set the current field quality to Good
void SetQualityBad() Set the current field quality to Bad
bool IsQualityGood() Check if the current field quality is Good
bool IsQualityBad() Check if the current field quality is Bad

 

 


Related topics:

  

CSense 2023- Last updated: June 24,2025